//
//  FlickrSearcher.h
//  FlickrSearch-UICollectionView
//
//  Created by cygarm on 15/10/4.
//  Copyright © 2015年 cygarm. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "AFNetworking.h"

@interface FlickrSearchResults : NSObject

@property(nonatomic) NSString *searchTerm;
@property(nonatomic) NSMutableArray *searchResults;

- (instancetype)initWithSearchTerm:(NSString *)searchTerm 
										 searchResults:(NSMutableArray *)searchResults;
@end

@interface FlickrPhoto : NSObject

@property(nonatomic, strong) UIImage *thumbnail;
@property(nonatomic, strong) UIImage *largeImage;
@property(nonatomic) NSString *photoID;
@property(nonatomic) NSInteger farm;
@property(nonatomic) NSString *server;
@property(nonatomic) NSString *secret;

- (CGSize) sizeToFillWidthOfSize:(CGSize)size;
- (void)loadLargeImageWithCompletion:(void(^)(FlickrPhoto *flickrPhoto, NSError *error))completion;

@end

@interface Flickr : NSObject

- (void)searchFlickrForTerm:(NSString *)searchTerm 
								 completion:(void(^)(FlickrSearchResults *results, NSError *error))completion;

@end

